<div class="page">
	<div class="menu">
		<?php include('modules/members/dashboard.php');?>
    </div>

	<div class="products-list" style="overflow:hidden;">
	<input type="hidden" id="table_name" value="customers"/>
	<div class="add_more" style="float:right;">
	    <a href="?m=persons&p=add_customer" title="เพิ่มลูกค้าใหม่">
	        <img src="css/images/plus.png" title="" width="64"/>
        </a>
	</div>
    	<table id="products_list" width="100%">
        	<thead>
              <tr>
               	<th>รหัสลูกค้า</th>
               	<th>ชื่อร้านค้า</th>
            	<th>ชื่อ - นามสกุล</th>
            	<th>ที่อยู่</th>
                <th>เบอร์โทรศัพท์</th>
                <th></th>
                <th></th>
              </tr>
            </thead>
            <tbody>
            <?php
            $sql = 'SELECT * FROM customers';
			$q = mysql_query($sql);
			while($rs = mysql_fetch_assoc($q)){?>
              <tr>
              <td>
                	<input type="hidden" id="id" value="<?php echo $rs['id'];?>"/>
					<?php echo $rs['code'];?>
               	</td>
                <td><?php echo $rs['store_name'];?></td>
                <td><?php echo $rs['name'];?></td>
                <td>
                    <?php echo $rs['address'].'<br/>'.$rs['tumbon'].'<br/>'.$rs['amphur'].'<br/>'.$rs['province'].'<br/>'.$rs['postcode'];?>
                </td>
                <td><?php echo $rs['mobile'];?></td>
                <td align="center">
                    <a href="#" id="delete"><img src="css/images/delete_32.png" title="ลบออก" /></a>
                </td>
                <td><a href="?m=persons&p=edit_customer&id=<?php echo $rs['id'];?>" id="edit" style="margin-left:4px;"><img src="css/images/edit_32.png" title="แก้ไข" /></a></td>
              </tr>
           	<?php } ?>
            </tbody>
        </table>
    </div>
</div>
<script type="text/javascript">
$(function(){
	oTable = $('#products_list').dataTable({
		"bJQueryUI": true,
		"sPaginationType": "full_numbers"
	});
});
</script>
<style type="text/css">
.ui-state-default .ui-icon {
	float:right;
}
</style>

